﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThanhTu.GNC.Media.KQXS.DataAccess.DAL;
using ThanhTu.GNC.Media.KQXS.DataAccess.DO;
using System.Data;

namespace ThanhTu.GNC.Media.KQXS.DataAccess.BL
{
    public class CommentBL : IDisposable
    {
        private CommentDAL vCommentDAL = null;
        private bool disposed = false;
        public CommentBL()
        {
            if (vCommentDAL == null)
            {
                vCommentDAL = new CommentDAL();
            }
        }
        ~CommentBL() { Dispose(false); }

        #region IDisposable Members

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    if (vCommentDAL != null)
                    {
                        vCommentDAL.Dispose();
                        vCommentDAL = null;
                    }
                }

                disposed = true;
            }
        }

        #endregion

        public int SaveComment(CommentDO vCommentDO) { return vCommentDAL.SaveComment(vCommentDO); }
        public List<CommentDO> SelectAll() { return vCommentDAL.SelectAll(); }
        public DataTable selectAll_Page(int pageIndex, int pageSize, ref int rowCount) { return vCommentDAL.selectAll_Page(pageIndex, pageSize, ref  rowCount); }
    }
}
